<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<script type="text/javascript">
    $(function() {
        $('#appGoodsManageAddTypeId').combotree({
            url : '${path }/appGoodsType/tree',
            parentField : 'pid',
            lines : true,
            panelHeight : 'auto'
        });

        $('#appGoodsManageAddForm').form({
            url : '${path }/appGoodsManage/add',
            onSubmit : function() {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.success) {
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    parent.$.messager.alert('错误', result.msg, 'error');
                }
            }
        });
     });

</script>
<div style="padding: 3px;">
    <form id="appGoodsManageAddForm" method="post">
        <table class="grid">
            <tr>
                <td>编码</td>
                <td>
                    <input name="id" type="hidden" value="">
                    <input name="goodsCode" type="text" value="" placeholder="请输入商品编码" class="easyui-validatebox" data-options="required:true">
                </td>
                <td>名称</td>
                <td>
                    <input name="goodsName" type="text" value="" placeholder="请输入商品名称" class="easyui-validatebox" data-options="required:true">
                </td>
            </tr>
            <tr>
                <td>重量</td>
                <td>
                    <input name="goodsWeight" type="text" value="" placeholder="请输入商品重量" class="easyui-validatebox" data-options="required:true">
                </td>
                <td>规格</td>
                <td>
                    <input name="goodsSpec" type="text" value="" placeholder="请输入规格" class="easyui-validatebox" data-options="required:true">
                </td>
            </tr>
            <tr>
                <td>价格</td>
                <td>
                    <input name="goodsPrice" type="text" value="" placeholder="价格" class="easyui-validatebox" data-options="required:true">
                </td>
                <td>库存</td>
                <td>
                    <input name="amount" type="text" value="1" placeholder="库存" class="easyui-validatebox" data-options="required:true">
                </td>
            </tr>
            <tr>
                <td>状态</td>
                <td >
                    <select  name="goodsStatus" class="easyui-combobox" data-options="width:100,height:29,editable:false,panelHeight:'auto'">
                        <option value="0">下架</option>
                        <option value="1">上架</option>
                    </select>
                </td>
                <td>停售</td>
                <td>
                    <select name="goodsStopFlag" class="easyui-combobox" data-options="width:100,height:29,editable:false,panelHeight:'auto'">
                        <option value="0">是</option>
                        <option value="1">否</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>商品图片</td>
                <td colspan="3">
                    <input id="photo_up" name="photo_up" type="file" multiple="true">
                    <input type="hidden" name="image1" id="image1" data-options="required:ture">
                </td>
            </tr>
            <tr></tr>
            <tr>
                <td>所属分类</td>
                <td><select id="appGoodsManageAddTypeId" name="appGoodsTypeId" style="width: 140px; height: 29px;" class="easyui-validatebox" data-options="required:true"></select></td>
            </tr>
        </table>
    </form>
</div>